
import 'package:im_app/im/socket/dto/base/Resp.dart';

import '../dto/base/Req.dart';
import '../dto/business/PullData.dart';
import '../dto/business/PullData2.dart';
import '../../service/Path.dart';
import 'RpcService.dart';

class RpcPullDataService extends RpcService {

	Future<ConfigItemList> pullConfigList(ConfigPullReq configPullReq) async {
		return sendDataAndOk(ImPath.pullConfigs, configPullReq, ConfigItemList.fromJson, 60);
	}

	Future<DepartmentInfoListItem> pullDepartmentInfoList(DepartmentInfoListReq departmentInfoListReq) async {
		return sendDataAndOk(ImPath.pullDepartments, departmentInfoListReq, DepartmentInfoListItem.fromJson, 60);
	}

	Future<UserInfoListItem> pullUserInfoList(UserInfoListReq userInfoListReq) async {
		return sendDataAndOk(ImPath.pullUsers, userInfoListReq, UserInfoListItem.fromJson, 60);
	}

	Future<GroupInfoListItem> pullGroupInfoList(GroupInfoListReq groupInfoListReq) async {
		return sendDataAndOk(ImPath.pullGroups, groupInfoListReq, GroupInfoListItem.fromJson, 60);
	}

	Future<ModuleItemList> pullModuleItemList(ModulePullReq modulePullReq) async {
		return sendDataAndOk(ImPath.pullModules, modulePullReq, ModuleItemList.fromJson, 60);
	}

	Future<MessageListItem> pullMessageBySessionIds(MessagePullBySessionIdsReq messagePullBySessionIdsReq) async {
		return sendDataAndOk(ImPath.pullMessageBySessionIds, messagePullBySessionIdsReq, MessageListItem.fromJson, 60);
	}

	Future<MessageListItem> pullMessageByMessageIds(MessagePullByMessageIdsReq messagePullByMessageIdsReq) async {
		return sendDataAndOk(ImPath.pullMessageByMessageIds, messagePullByMessageIdsReq, MessageListItem.fromJson, 60);
	}

	Future<void> okMessages(OkListReq okListReq) async {
		return sendDataAndOk(ImPath.okMessages, okListReq, OkResp.fromJson);
	}
	Future<SessionItemList> pullSessions(SessionPullReq sessionPullReq) async {
		return sendDataAndOk(ImPath.pullSessions, sessionPullReq, SessionItemList.fromJson, 60);
	}

	Future<SensitiveWordListItem> pullSensitiveWords(SensitiveWordPullReq sensitiveWordPullReq) async {
		return sendDataAndOk(ImPath.pullSensitiveWords, sensitiveWordPullReq, SensitiveWordListItem.fromJson, 60);
	}

	Future<CollectListItem> pullCollects(CollectPullReq collectPullReq) async {
		return sendDataAndOk(ImPath.pullCollects, collectPullReq, CollectListItem.fromJson, 60);
	}
}